// Learn TypeScript:
//  - https://docs.cocos.com/creator/manual/en/scripting/typescript.html
// Learn Attribute:
//  - https://docs.cocos.com/creator/manual/en/scripting/reference/attributes.html
// Learn life-cycle callbacks:
//  - https://docs.cocos.com/creator/manual/en/scripting/life-cycle-callbacks.html

const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {

    @property(cc.Button)
    return_btn: cc.Button = null;
    @property(cc.Label)
    name_label: cc.Label = null;
    

    // LIFE-CYCLE CALLBACKS:
    return_scence(){
        cc.director.loadScene('nameMake')
    }

    onLoad () {
        let a = window["Win_Global"];
        var str = ""
        for(var i=0;i<a.items.length;++i){
            str += a.items[i].itemName;
        }
        this.name_label.string = str;
        this.return_btn.node.on(cc.Node.EventType.TOUCH_END, this.return_scence,this);
    }

    start () {

    }

    // update (dt) {}
}
